package com.server.modules.api.web;

import com.server.common.utils.StringUtils;
import com.server.modules.api.Base.BaseAppController;
import com.server.modules.api.utils.Constants;
import com.server.modules.api.vo.BaseQueryVo;
import com.server.modules.api.vo.FriendQueryVO;
import com.server.modules.api.vo.LoanTypeListVo;
import com.server.modules.sys.entity.User;
import com.server.modules.sys.entity.member.Member;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2016/9/9.
 */
@Controller
@RequestMapping(value = "/api/manager/")
public class ManagerAPIController extends BaseAppController{
    @ResponseBody
    @RequestMapping(value = "getManagerList", method = RequestMethod.POST)
    public BaseQueryVo getManagerList(HttpServletRequest request,LoanTypeListVo vo){
        BaseQueryVo rvo = new BaseQueryVo();
        List<User> users = userAPIService.getMembersByLoanId(vo);
        if (users != null && users.size() > 0){
            rvo.setData(users);
        }
        return  rvo;
    }


    @ResponseBody
    @RequestMapping(value = "/getManagerDetailByhxId", method = RequestMethod.POST)
    public BaseQueryVo getManagerDetailByhxId(HttpServletRequest request,BaseQueryVo vo){
        BaseQueryVo rvo = new BaseQueryVo();
        User user = userAPIService.getUserByHxId(vo.getObjId());
        
        if (user != null){
            rvo.setData(user);
        }
        return  rvo;
    }
    @ResponseBody
    @RequestMapping(value = "/getManagerDetailById", method = RequestMethod.POST)
    public BaseQueryVo getManagerDetailById(HttpServletRequest request,BaseQueryVo vo){
        BaseQueryVo rvo = new BaseQueryVo();
        User user = userAPIService.getUserById(vo.getObjId());
        if (user != null){
            rvo.setData(user);
        }
        return  rvo;
    }
}
